package com.resrun.enums;

import lombok.Getter;

@Getter
public enum CertStateEnum {

    INIT((byte) 0, "正常"),
    PASS((byte) 1, "已过期"),
    NOT_PASS((byte) 2, "已吊销");


    private final byte state;
    private final String desc;

    CertStateEnum(byte state, String desc) {
        this.state = state;
        this.desc = desc;
    }

    public static CertStateEnum of(byte state) {
        for (CertStateEnum caStateEnum : CertStateEnum.values()) {
            if (caStateEnum.state == state) {
                return caStateEnum;
            }
        }

        return null;
    }

}
